package com.hu.hrm;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 用户服务主配置类
 * @EnableDiscoveryClient :开启服务发现 (开启注册中心的客户端功能)
 * @EnableEurekaClient : 开启Eureka client客户端(只是针对Eureka有用)
 * @EnableZuulProxy ：开启zuul
 */
//(scanBasePackages = {"com.hu.hrm.fallback"})
//(scanBasePackages = {"com.hu.hrm.fallback","com.hu.hrm.feignclients"})
@SpringBootApplication
@MapperScan("com.hu.hrm.mapper")  //注意是否要开启事务
@EnableTransactionManagement //开启事务管理器
@EnableFeignClients({"com.hu.hrm.feignclients"})
public class CourseServerApplication2020 {
    public static void main(String[] args) {
        SpringApplication.run(CourseServerApplication2020.class);
    }

    /**
     * 分页插件   mybatis-plus的分页插件：PaginationInterceptor
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}